package com.bdq.common.utils;

import com.alibaba.fastjson.JSON;
import com.bdq.common.constants.Constant;

/**
 * @author malei
 * @date 2024-05-02 19:40
 */
public class BaseConfigUtil {

    /**
     * 获取配置
     *
     * @param name
     * @param <T>
     * @return
     */
    public static <T> T getConfig(String name, Class<T> clazz) {
        Object valueObj = RedisUtil.hGet(Constant.RedisKey.CONFIG, name);
        return JSON.parseObject(String.valueOf(valueObj), clazz);
    }
}
